#ifndef _VECTOR_H
#define _VECTOR_H
#include <math.h>
/**
===========================
Vector
3-tuple
===========================
*/
class Vector3f
{
public:
    Vector3f(void) { ZeroOut(); };
    Vector3f( float x, float y, float z ) { Set(x,y,z); };
    Vector3f( float* data ) { Set( data ); };
    Vector3f( const Vector3f &v ) { Set( v ); };

    /*---------------------------------------
        Operator overloads
    ----------------------------------------*/
    inline Vector3f operator+( Vector3f &v)  const { return Add( v ); };
    inline Vector3f operator-( Vector3f &v)  const { return Subtract( v ); };
    inline Vector3f operator*( float scalar) const { return Multiply( scalar ); };
    inline Vector3f operator/( float scalar) const { return Divide( scalar ); };
    inline float    operator[]( int index )  const { return m_data[index]; };


    inline float GetX() const { return m_data[0]; };
    inline float GetY() const { return m_data[1]; };
    inline float GetZ() const { return m_data[2]; };

    /** Zero out the vector */
    void ZeroOut();
    /** Length/magnatude of the vector */
    float Length() const;
    /** Normalize the vector */
    void Normalize();
    /** Multiply two vectors */
    void Multiply( const Vector3f &v ); // TODO

    /** Multiply by a scalar */
    Vector3f Multiply( float scalar ) const;
    /** Divide by a scalar */
    Vector3f Divide( float scalar ) const;
    /** Add */
    Vector3f Add( Vector3f &v ) const;
    /** Subtract */
    Vector3f Subtract( Vector3f &v ) const;

    /** Dot Product of two vectors */
    float DotProduct( Vector3f &v );

    /** Cross Product of two vectors */
    Vector3f CrossProduct( Vector3f &v ) const;

    /** Angle between two vectors */
    float Angle( Vector3f &v );

    /** Set the vector */
    void Set( float x, float y, float z );
    void Set( float* v );
    void Set( const Vector3f &v );

    /** Get the vector data */
    float* GetData() { return m_data; };

private:
    float   m_data[3];
public:
    virtual ~Vector3f(void) { };
};

#endif